import { createStore } from "vuex";

const store = createStore({
  state: {
    pageLoading: true,
  },
  getters: {
    getPageLoading(state) {
      return state.pageLoading;
    }
  },
  mutations: {
    updatePageLoading(state, payload) {
      state.pageLoading = payload;
    }
  },
  actions: {
    setPageLoading({ commit }, payload) {
      commit("updatePageLoading", payload);
    }
  },
});

export default store;
